﻿@model cloudscribe.Core.Web.ViewModels.SiteSettings.RegisterInfoViewModel
@inject ISummernoteOptionsResolver summernoteOptionsResolver
@inject ICkeditorOptionsResolver ckeditorOptionsResolver
@inject IStringLocalizer<CloudscribeCore> sr
@inject ICoreThemeHelper themeHelper
@{
    var themeSettings = themeHelper.GetThemeSettings();
    var ckOptions = await ckeditorOptionsResolver.GetCkeditorOptions();
    if (themeSettings.AdminSideNavExpanded) { ViewData["SideNavToggle"] = "show"; }
    ViewData["SideNavVisible"] = true;
    var summernoteOptions = await summernoteOptionsResolver.GetSummernoteOptions();
}
<h2>@ViewBag.Title</h2>
<form method="post" role="form" asp-antiforgery="true" data-submit-once="true">
    <div asp-validation-summary="All" class="text-danger"></div>
    <input asp-for="SiteId" type="hidden" />
    <div class="mb-3">
        <label class="form-label" asp-for="RegistrationPreamble">@sr["Registration Preamble"]</label>
        <textarea asp-for="RegistrationPreamble" rows="5"
            data-summernote-unobtrusive=""
            data-summernote-config-url="@summernoteOptions.CustomConfigPath"
            data-summernote-toolbar-config-url="@summernoteOptions.CustomToolbarConfigPath"
            data-summernote-config-language="@summernoteOptions.LanguageCode"
            data-summernote-config-dropfileuploadurl="@summernoteOptions.DropFileUrl"
            data-summernote-config-filebrowserurl="@summernoteOptions.FileBrowseUrl"
            data-summernote-config-imagebrowseurl="@summernoteOptions.ImageBrowseUrl">
        </textarea>
        <span asp-validation-for="RegistrationPreamble" class="text-danger"></span>
    </div>
    <div class="mb-3">
        <label class="form-label" asp-for="RegistrationAgreement">@sr["Registration Agreement/Terms of Use"]</label>
        <textarea asp-for="RegistrationAgreement" rows="5"
            data-summernote-unobtrusive=""
            data-summernote-config-url="@summernoteOptions.CustomConfigPath"
            data-summernote-toolbar-config-url="@summernoteOptions.CustomToolbarConfigPath"
            data-summernote-config-language="@summernoteOptions.LanguageCode"
            data-summernote-config-dropfileuploadurl="@summernoteOptions.DropFileUrl"
            data-summernote-config-filebrowserurl="@summernoteOptions.FileBrowseUrl"
            data-summernote-config-imagebrowseurl="@summernoteOptions.ImageBrowseUrl">
        </textarea>
        <span asp-validation-for="RegistrationAgreement" class="text-danger"></span>
    </div>
    <div class="mb-3">
        <div class="form-check">
            <input asp-for="RequireUsersToAcceptChangedAgreement" class="form-check-input" />
            <label asp-for="RequireUsersToAcceptChangedAgreement" class="form-check-label">@sr["On saving, force existing users to accept this changed agreement?"]</label>
        </div>
    </div>
    <div class="mb-3">
        <button id="btnSave" name="submit" type="submit" class="btn btn-primary" data-disabled-text='@sr["Working..."]' data-enabled-text='@sr["Save"]'>@sr["Save"]</button>
    </div>
</form>
@section Styles {
    <link href="/cr/css/summernote-bs5.min.css" rel="stylesheet">
}
@section SideNav {
    <partial name="AdminSideNav" />
}
@section Toolbar{
    <partial name="AdminSideNavToggle" />
}
@section Scripts {
    <partial name="AdminSideNavScripts" />
    <script src="~/cr/js/jquery.validate.min.js"></script>
    <script src="~/cr/js/jquery.validate.unobtrusive.min.js"></script>
    <script src="~/cr/js/jquery.validate.hooks.min.js"></script>
    <script src="~/cr/js/jqueryvaildation.submitonce-unobtrusive.min.js"></script>
    <script src="~/cr/js/ckeditor4114/ckeditor.js"></script>
    <script src="~/cr/js/cloudscribe-ckeditor-unobtrusive.min.js"></script>
    <partial name="SummernoteScripts" />
}
